//
// Created by wujehy on 2020/8/3.
//

#include <string>
#include "Test2Mod.h"
#include <handy/logging.h>
#include "../NetWorkWarpper.h"
#include <handy/handy.h>

using handy::Logger;

int Test2Mod::type()
{
    return Type::Mod_Test2;
}

int Test2Mod::depackage(int tcpid, int type, void *data, int len, void *userdata)
{
    std::string message = std::string((char *) data, len );
    info( "Test2Mod  depackage : %s ,id = %ld ", message.c_str(), tcpid );

    auto find = this->context->m_id_client_map.find( tcpid );
    if (find != context->m_id_client_map.end())
    {
        find->second->send( "test" );
    }
    return -2;
}

void Test2Mod::init_finished()
{

}
